import React from 'react';
import {inject, observer} from 'mobx-react';
import {Button, Spin, Modal, Icon, message} from 'antd';
import {
  WeaDialog,
  WeaNewScroll,
  WeaFormItem,
  WeaSearchGroup,
  WeaInput,
  WeaBrowser,
  WeaDatePicker,
  WeaUpload,
  WeaRichText,
  WeaTextarea,
  WeaInputNumber,
  WeaPopoverHrm,
  WeaLocaleProvider
} from 'ecCom';
import NewLinkeb from '../../../public/newlinked/NewLinkeb';
import * as Util from '../../../util/Util.js';
import TaskDetailDialog from '../../task/TaskDetailDialog';
import '../../../style/plan/planDetailView.less';
import FeedBack from '../../../public/feedback/FeedBack';
const toJS = mobx.toJS;
const getLabel = WeaLocaleProvider.getLabel;
@inject ('planDetailViewStore', 'planReportViewStore')
@observer
export default class PlanDetail extends React.Component {
  constructor (props) {
    super (props);
    this.state = {
      key: this.props.detailid,
      showvisible: false,
      showKey: '',
      locationkey: new Date ().getTime (),
    };
    this.mirror = {
      37: '/spa/document/index.jsp?id=',
      7: '/spa/crm/mobx/index.html#/main/crm/customerView?customerId=',
      152: '/workflow/request/ViewRequestForwardSPA.jsp?requestid=',
      8: '/spa/prj/index.html#/main/prj/projectCard?prjid=',
      1: '/spa/hrm/index_mobx.html#/main/hrm/card/cardInfo/',
      wrltsk: '/spa/workrelate/static/index.html#/main/workrelate/task/taskDetail?id=',
    };
  }
  componentWillMount () {
    //一些初始化请求
    const {planDetailViewStore, canedit, datatype, detailid,category} = this.props;
    planDetailViewStore.getDetailView ({
      plandetailid: detailid,
      datatype: datatype,
      category:category,
      programid:this.props.planReportViewStore.resData.programid
    });
    this.setState({key:detailid})
  }

  componentWillReceiveProps(nextProps){
    const {planDetailViewStore,detailid} = this.props;
    if(nextProps.detailid !=detailid){
      this.setState({key:nextProps.detailid})
      planDetailViewStore.getDetailView ({
        plandetailid: nextProps.detailid
      });
    }
  }


  getButton = () => {
    let buttonsCreate = [];
    buttonsCreate.push (
      <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@on16sr@close`} type="ghost" onClick={this.onClose}>{getLabel('309','关闭') }</Button>
    );

    return buttonsCreate;
  };
  onClose =()=> {
    if (typeof this.props.onClose === 'function') {
      this.props.onClose (this.props.planDetailViewStore.editParams,this.props.detailid);
    }else{
      this.props.visible=false
    }
  }
  onInputChange (val, type,ismust) {
    let {planDetailViewStore, resourceid} = this.props;
    if(ismust==1 && (val==undefined || val=="")){
      message.info (getLabel('509065','请输入必填项') );
      return;
    }
    planDetailViewStore.editParams[type] = val;
   planDetailViewStore.editParams["s_"+type] = typeof(val) =='string'?val.replace(/\n/g,"<br/>"):val;
    planDetailViewStore.saveDetailView ({
      fieldname: type,
      fieldvalue: val,
      plandetailid: this.props.detailid,
      resourceid: resourceid,
      fieldtype: 'str',
    });
  }
  onDateChange (val, type,ismust) {
    let {planDetailViewStore, resourceid} = this.props;
    if(ismust==1 && (val==undefined || val=="")){
      //planDetailViewStore.editParams[type] = "";
      message.info (getLabel('509065','请输入必填项') );
      return;
    }
    //深拷贝
    let beforeValue = JSON.parse (
      JSON.stringify (toJS (planDetailViewStore).editParams)
    )[type];
    let flag = true;
    let days = 0;
    let tip = '';
    let col = '';
    if (val != '') {
      if (
        type == 'begindate2' &&
        planDetailViewStore.editParams['enddate2'] != ''
      ) {
        days = Util.DateDiffDays (
          val,
          planDetailViewStore.editParams['enddate2']
        );
        if (days < 0) {
          flag = false;
          tip = getLabel('509026','实际开始日期不能大于实际结束日期!') ;
        } else {
          col = 'days2';
        }
      } else if (
        type == 'enddate2' &&
        planDetailViewStore.editParams['begindate2'] != ''
      ) {
        days = Util.DateDiffDays (
          planDetailViewStore.editParams['begindate2'],
          val
        );
        if (days < 0) {
          flag = false;
          tip = getLabel('509027','实际结束日期不能小于实际开始日期!') ;
        } else {
          col = 'days2';
        }
      } else if (
        type == 'begindate1' &&
        planDetailViewStore.editParams['enddate1'] != ''
      ) {
        days = Util.DateDiffDays (
          val,
          planDetailViewStore.editParams['enddate1']
        );
        if (days < 0) {
          flag = false;
          tip = getLabel('509028','计划开始日期不能大于计划结束日期!') ;
        } else {
          col = 'days1';
        }
      } else if (
        type == 'enddate1' &&
        planDetailViewStore.editParams['begindate1'] != ''
      ) {
        days = Util.DateDiffDays (
          planDetailViewStore.editParams['begindate1'],
          val
        );
        if (days < 0) {
          flag = false;
          tip = getLabel('509029','计划结束日期不能小于计划开始日期!') ;
        } else {
          col = 'days1';
        }
      }
    }
    if (flag) {
      planDetailViewStore.canView = false;
      planDetailViewStore.editParams[type] = val;
      planDetailViewStore.editParams["s_"+type] = val;
      if (col != '') {
        planDetailViewStore.editParams[col] = days;
        planDetailViewStore.editParams["s_"+col] = days;
      }
      planDetailViewStore.saveDetailView ({
        fieldname: type,
        fieldvalue: val,
        plandetailid: this.props.detailid,
        resourceid: resourceid,
        fieldtype: 'str',
        otherfield: col,
        othervalue: days,
      });
      planDetailViewStore.canView = true;
    } else {
      planDetailViewStore.canView = false;
      planDetailViewStore.editParams[type] = '';
      planDetailViewStore.editParams["s_"+type] = "";
      planDetailViewStore.editParams[type] = beforeValue;
      planDetailViewStore.editParams["s_"+type] = beforeValue;
      message.info (tip);
      planDetailViewStore.canView = true;
    }
    return flag
  }
  onChangeBrowser (ids, names, datas, typeIds, typeArray) {
    let {
      planDetailViewStore,
      resourceid,
      canedit,
      datatype,
      detailid,
    } = this.props;
    if( ids && typeof ids == "string" &&  !ids.endsWith(","))ids+=','
    planDetailViewStore.editParams[typeIds] = ids;

    planDetailViewStore.saveDetailView ({
      fieldname: typeIds,
      fieldvalue: planDetailViewStore.editParams[typeIds],
      plandetailid: this.props.detailid,
      resourceid: resourceid,
      fieldtype: 'str',
    });
  }
  /**上传附件 */
  uploadChange (ids, list) {
    let {planDetailViewStore, resourceid, planReportViewStore} = this.props;
    if (ids.length > 0) {
      let newAddFileids = '';
      if (planDetailViewStore.editParams['fileids'] == undefined) {
        planDetailViewStore.editParams['fileids'] = '';
        planDetailViewStore.editParams['filearray'] = [];
      }
      
      for (let i = 0; i < list.length; i++) {
        let fileA = {};
        if (
          planDetailViewStore.editParams.fileids.indexOf (',' + ids[i] + ',') ==
          -1
        ) {
          planDetailViewStore.editParams.fileids += ids[i] + ',';
          fileA.id = ids[i];
          fileA.name = list[i].filename;
          fileA.size = list[i].filesize;
          fileA.fileid = list[i].imagefileid;
          planDetailViewStore.editParams.filearray.push (fileA);
        }
      }
      //planDetailViewStore.canEdit = false;
      planReportViewStore.uploadReset = false;
      planDetailViewStore.saveDetailView ({
        fieldname: 'fileids',
        fieldvalue: ids,
        plandetailid: this.state.key,
        resourceid: resourceid,
        doback: function () {
          planReportViewStore.uploadReset = true;
        },
      });
    }
  }
  onLinkClick (id, name, type, typeIds, typeArray, fileid) {
    let {planDetailViewStore, resourceid} = this.props;
    if (type == 2) {
      //删除
      let sendValue = '';
      let fieldtype = 'str';
      let vals = planDetailViewStore.editParams[typeIds];
      if (vals.length > 0 && !Util.startWith (vals, ',')) {
        vals = ',' + vals;
      }
      if (vals.length > 0 && !Util.endWith (vals, ',')) {
        vals = vals + ',';
      }
      let _index = vals.indexOf (',' + id + ',');
      if (_index > -1 && id != '') {
        vals =
          vals.substring (0, _index + 1) +
          vals.substring (_index + (id + '').length + 2);
        if (vals == ',') {
          vals = '';
        }
        planDetailViewStore.editParams[typeIds] = vals;
        if (typeIds == 'fileids') {
          //附件
          sendValue = id;
          fieldtype = 'del';
        } else {
          //其他
          sendValue = vals;
        }
      }
      //对array进行处理
      let array = planDetailViewStore.editParams[typeArray];
      array.map ((elemnet, index) => {
        if (elemnet.id == id) {
          let index = planDetailViewStore.editParams[typeArray].indexOf (
            elemnet
          );
          if (index > -1) {
            planDetailViewStore.editParams[typeArray].splice (index, 1);
          }
          // planDetailViewStore.editParams[typeArray].remove(elemnet);
        }
      });
      planDetailViewStore.refreshMark=!planDetailViewStore.refreshMark;
      planDetailViewStore.canEdit=!planDetailViewStore.canEdit
      planDetailViewStore.saveDetailView ({
        fieldname: typeIds,
        fieldvalue: sendValue,
        plandetailid: this.state.key,
        resourceid: resourceid,
        fieldtype: fieldtype,
      });
      planDetailViewStore.refreshMark=!planDetailViewStore.refreshMark;
      planDetailViewStore.canEdit=!planDetailViewStore.canEdit
    } else if (type == 1 ) {
      this.props.planReportViewStore.viewDocFiled ({
        id: id,
        plandetailid:this.props.detailid,
        relateId: this.props.detailid,
        type: 4,
        doback: function () {
          Util.opendoc (id);
        },
      });
    } else {
      this.props.planReportViewStore.viewDocFiled ({
        id: id,
        plandetailid:this.props.detailid,
        relateId: this.props.detailid,
        type: 4,
        doback: function () {
          Util.downloads (fileid);
        },
      });
    }
  }
  //反馈 发布
  planRelease () {
    const {planDetailViewStore} = this.props;
    if (planDetailViewStore.feedbackContent != '') {
      planDetailViewStore.saveDetailView ({
        plandetailid: this.state.key,
        content: planDetailViewStore.feedbackContent,
        operation: 'add_feedback',
      });
    } else {
      Modal.warning ({
        title: getLabel('558','提示') ,
        content: getLabel('508792','反馈信息不能为空!') ,
      });
    }
  }

  setfeedbackContent (v) {
    const {planDetailViewStore} = this.props;
    planDetailViewStore.feedbackContent = v;
  }
  onMoreFeedbackClick () {
    const {planDetailViewStore} = this.props;
    planDetailViewStore.getFbInfo ({plandetailid: this.state.key});
  }
  //category-目录id  detailid-计划明细id style-dialog宽高等 resourceid-当前报告的所属人id visible-控制dialog显隐
  render () {
    const {
      planReportViewStore,
      planDetailViewStore,
      category,
      visible,
      inOrOut,
      rowIndex,
      type,
      planstatus
    } = this.props;
    //后端返回的目录

    const resCategory = this.props.planDetailViewStore.category
    const {locationkey, showvisible, showKey} = this.state;

    let {resData:{summaryin,summaryout,planlist,planmap,summarymap},isSummaryInFieldCanEdit} = this.props.planReportViewStore

    let {
      spinning,
      editParams,
      emptyArray,
      showtask,
      feedbackContent,
      fblist,
      fblastcount,
      emptyReplaceDatas,
      customList,
      canEdit
    } = planDetailViewStore;

    let canRelateEdit = canEdit && type=='report'
    return (
      <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@he22u1`}
        visible={visible}
        title={getLabel('509039','计划详情')}
        icon="icon-coms-implement"
        iconBgcolor='rgb(150, 53, 138)'
        className="createWorkPlan"
        buttons={this.getButton ()}
        style={
          this.props.style || {width: window.innerWidth*0.5, height: window.innerHeight - 140}
        }
        closable={true}
        onCancel={this.onClose}
      >
        <div className="wea-workrelate-plan-detailview">
          <Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@bmvz5n`} spinning={spinning}>
            <WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@tc3k3z`}
              height={
                this.props.style
                  ? this.props.style.height
                  : window.innerHeight - 190
              }
            >
              <WeaPopoverHrm ecId={`${this && this.props && this.props.ecId || ''}_WeaPopoverHrm@fwg7lo`} />
              <WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@jvlkfl`} title={getLabel('81711','基本信息') } needTigger={true} showGroup={true}>
                {customList &&
                  customList.length > 0 &&
                  customList.map ((elemnet, idx) => {
                    let editAuth = canEdit;
                    let ismust = "0";
                    //除了报告以外打开的不能编辑 如任务
                    if( type!='report'){
                      editAuth = false
                    }else{
                      //处理在计划的属性不能编辑                    
                      if(inOrOut == 'in'){
                        let isSummaryInFieldCanEdit = planReportViewStore.isSummaryInFieldCanEdit (elemnet.fieldname, planmap)
                        if(!isSummaryInFieldCanEdit){
                          editAuth = false
                        }
                      }
                      //除了没保存草稿和退回的 不能编辑
                      if(planstatus!='0' && planstatus!='2' && planstatus!=""){
                        editAuth=false
                        canRelateEdit=false
                      }
                      //处理必填
                      if(inOrOut == 'in'){
                        summarymap.list.map(v=>{
                          if(v.fieldname==elemnet.fieldname && v.ismust==1){
                            ismust=1
                          }
                        })
                      }else if(inOrOut == 'out'){
                        summarymap.list.map(v=>{
                          if(v.fieldname==elemnet.fieldname && v.ismust==1){
                            ismust=1
                          }
                        })
                      }else{
                        planmap.list.map(v=>{
                          if(v.fieldname==elemnet.fieldname && v.ismust==1){
                            ismust=1
                          }
                        })
                      }
                    }
                    let elementViewAttr=editAuth?2:1
                    if(editAuth && ismust==1){
                      elementViewAttr =3
                    }
                    return (
                      <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@hy6h80@${idx}`}
                        label={elemnet.showname}
                        labelCol={{span: 4}}
                        wrapperCol={{span: 18}}
                        className={
                          elemnet.inputtype == 3
                            ? 'plan-item-' + elemnet.fieldname
                            : ''
                        }
                      >
                        {elemnet.inputtype == 1 &&
                          <div>
                          <WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@zwemy0@${idx}`}
                            onBlur={value =>{
                              this.onInputChange (value, elemnet.fieldname,ismust)}
                            }
                            //defaultValue={elemnet.showval}
                            value={editParams[elemnet.fieldname]}
                            placeholder={getLabel('83869','请输入')  + elemnet.showname}
                            viewAttr={elementViewAttr}
                          />
                          </div>
                        }
                        {elemnet.inputtype == 2 &&
                          <WeaTextarea ecId={`${this && this.props && this.props.ecId || ''}_WeaTextarea@qdvrmq@${idx}`}
                          //defaultValue={elemnet.showval}
                            onBlur={value =>
                             { 
                              this.onInputChange (value, elemnet.fieldname,ismust)}}
                              value={editParams[elemnet.fieldname]}
                            viewAttr={elementViewAttr}
                          />}
                        {elemnet.inputtype == 3 &&
                        
                          <WeaDatePicker ecId={`${this && this.props && this.props.ecId || ''}_WeaDatePicker@fip34x@${idx}`}
                          //defaultValue={elemnet.showval}
                            onChange={value =>
                              {
                               this.onDateChange (value, elemnet.fieldname,ismust)
                              }
                            }
                            value={editParams[elemnet.fieldname]}
                            viewAttr={elementViewAttr}
                          />}
                        {elemnet.inputtype == 4 &&
                          <WeaInputNumber ecId={`${this && this.props && this.props.ecId || ''}_WeaInputNumber@s4z4b8@${idx}`}
                          //defaultValue={elemnet.showval}
                          value={editParams[elemnet.fieldname]}
                            viewAttr={elementViewAttr}
                            onChange={value =>
                              {
                              this.onInputChange (value, elemnet.fieldname,ismust)}}
                          />
                          }
                      </WeaFormItem>
                    );
                  })}
              </WeaSearchGroup>
              <WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@k3t1rv`} title={getLabel('22078','相关信息') } needTigger={true} showGroup={true}>
                {showtask &&
                  <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@9y5z1f`}
                    label={getLabel('33414','相关任务') }
                    labelCol={{span: 4}}
                    wrapperCol={{span: 18}}
                    className="plan-item-task"
                  >
                    <div className="xgrw-div">

                      <WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@ol8oe2`}
                        onChange={(ids, names, datas) => {
                          this.onChangeBrowser (
                            ids,
                            names,
                            datas,
                            'taskids',
                            'taskarray'
                          );
                        }}
                        replaceDatas={editParams['taskarray']}
                        linkUrl={this.mirror['wrltsk']}
                        title={getLabel('33414','相关任务') }
                        type="wrltsk"
                        viewAttr={canRelateEdit ? 2 : 1}
                        isSingle={false}
                        inputStyle={{width: '100%'}}
                      />

                    </div>
                  </WeaFormItem>}
                <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@at0rd7`}
                  label={getLabel('857','相关文档') }
                  labelCol={{span: 4}}
                  wrapperCol={{span: 18}}
                  className="plan-item-doc"
                >

                  <WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@t9lgb6`}
                    title={getLabel('857','相关文档') }
                    type={9}
                    inputStyle={{width: '100%'}}
                    viewAttr={canRelateEdit ? 2 : 1}
                    replaceDatas={editParams['docarray']}
                    linkUrl={this.mirror[37]}
                    onChange={(ids, names, datas) =>
                      this.onChangeBrowser (
                        ids,
                        names,
                        datas,
                        'docids',
                        'docarray'
                      )}
                    isSingle={false}
                  />
                </WeaFormItem>
                <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@f8152e`}
                  label={getLabel('22105','相关流程') }
                  labelCol={{span: 4}}
                  wrapperCol={{span: 18}}
                  className="plan-item-wf"
                >

                  <WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@vby4wd`}
                    title={getLabel('22105','相关流程') }
                    type={16}
                    inputStyle={{width: '100%'}}
                    onChange={(ids, names, datas) =>
                      this.onChangeBrowser (
                        ids,
                        names,
                        datas,
                        'wfids',
                        'wfarray'
                      )}
                    replaceDatas={editParams['wfarray']}
                    linkUrl={this.mirror[152]}
                    viewAttr={canRelateEdit ? 2 : 1}
                    isSingle={false}
                  />
                </WeaFormItem>
                <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@7smc16`}
                  label={getLabel('783','相关客户') }
                  labelCol={{span: 4}}
                  wrapperCol={{span: 18}}
                  className="plan-item-crm"
                >

                  <WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@p6qna5`}
                    title={getLabel('783','相关客户') }
                    type={7}
                    inputStyle={{width: '100%'}}
                    replaceDatas={editParams['crmarray']}
                    linkUrl={this.mirror[7]}
                    viewAttr={canRelateEdit ? 2 : 1}
                    onChange={(ids, names, datas) =>
                      this.onChangeBrowser (
                        ids,
                        names,
                        datas,
                        'crmids',
                        'crmarray'
                      )}
                    isSingle={false}
                  />
                </WeaFormItem>
                <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@x8b7yt`}
                  label={getLabel('782','相关项目') }
                  labelCol={{span: 4}}
                  wrapperCol={{span: 18}}
                  className="plan-item-project"
                >

                  <WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@6o76ac`}
                    title={getLabel('782','相关项目') }
                    type={8}
                    inputStyle={{width: '100%'}}
                    linkUrl={this.mirror[8]}
                    replaceDatas={editParams['projectarray']}
                    viewAttr={canRelateEdit ? 2 : 1}
                    onChange={(ids, names, datas) =>
                      this.onChangeBrowser (
                        ids,
                        names,
                        datas,
                        'projectids',
                        'projectarray'
                      )}
                    isSingle={false}
                  />
                </WeaFormItem>
                <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@lxzbtd`}
                  label={ getLabel('22194','相关附件') }
                  labelCol={{span: 4}}
                  wrapperCol={{span: 18}}
                  className="plan-item-file"
                >
                  <div className="xgfj-div">
                    <div className="linked-div">
                      <NewLinkeb ecId={`${this && this.props && this.props.ecId || ''}_NewLinkeb@6o1y1o`}
                        onLinkClick={(id, name, type,fileid) =>
                          this.onLinkClick (
                            id,
                            name,
                            type,
                            'fileids',
                            'filearray',
                            fileid
                          )}
                        linkurl=""
                        hasdownload={true}
                        linkdatas={editParams.filearray}
                        hasdel={canRelateEdit}
                      />
                    </div>
                    {canRelateEdit &&
                      this.props.planReportViewStore.uploadReset &&
                      <div className="xgfj-edit">
                        <WeaUpload ecId={`${this && this.props && this.props.ecId || ''}_WeaUpload@tsrsjz`}
                          uploadUrl={
                            '/api/doc/upload/uploadFile2Doc?category=' + (category?category:resCategory)
                          }
                          category={category?category:resCategory}
                          showClearAll={false}
                          onChange={(ids, list) =>
                            this.uploadChange (ids, list)}
                        />
                      </div>}
                  </div>
                </WeaFormItem>
              </WeaSearchGroup>
              <WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@14fut2`} title={getLabel('83596','反馈信息') } needTigger={true} showGroup={true}>
                <WeaRichText ecId={`${this && this.props && this.props.ecId || ''}_WeaRichText@mq2g6b`}
                  onChange={v => this.setfeedbackContent (v)}
                  value={feedbackContent}
                  ckConfig={{
                    toolbar: [
                      {name: 'document', items: ['Source']},
                      {
                        name: 'paragraph',
                        items: [
                          'JustifyLeft',
                          'JustifyCenter',
                          'JustifyRight',
                          '-',
                          'NumberedList',
                          'BulletedList',
                        ],
                      },
                      {name: 'styles', items: ['Format', 'Font', 'FontSize']},
                      {name: 'colors', items: ['TextColor']},
                      {
                        name: 'basicstyles',
                        items: ['Bold', 'Italic', 'Underline', 'Strike'],
                      },
                      {name: 'insert', items: ['Table', 'Smiley']},
                    ],
                    height: 80,
                    startupFocus: false,
                    autoGrow_minHeight: 80,
                    autoGrow_maxHeight: 80,
                  }}
                  bottomBarRight={{
                    width: 100,
                    Component: [
                      <span
                        className="wea-rich-text-toolbar-bottom-item"
                        style={{position: 'relative'}}
                      >
                        <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@cuevz4@submit`} className="wea-button-release"  onClick={() => this.planRelease ()}>
                          <span>
                            <span className="icon-coms-Release" />
                            <span style={{marginLeft: '2px'}}>{ getLabel('615','提交')}</span>
                          </span>
                        </Button>
                      </span>,
                    ],
                  }}
                  onToolsChange={(name, ids, list, type) =>
                    Util.transfStr (name, ids, list, type, this.mirror)}
                />

                {fblist.map (v => {
                  v.operatedate = v.datetime;
                })}
                {fblist &&
                  fblist.length > 0 &&
                  <FeedBack ecId={`${this && this.props && this.props.ecId || ''}_FeedBack@04cer8`} dataSource={fblist} />}

                {fblastcount > 0 &&
                  <div
                    className="tabs-Feedback-more"
                    onClick={() => this.onMoreFeedbackClick ()}
                  >
                    {getLabel('387979','加载更多') } <Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@pkmnht`} type="down" />
                  </div>}

              </WeaSearchGroup>
              <TaskDetailDialog ecId={`${this && this.props && this.props.ecId || ''}_TaskDetailDialog@pf6tre`}
                detailKey={showKey}
                locationkey={locationkey}
                visable={showvisible}
                onlyClose={() => this.setState ({showvisible: false})}
                style={{
                  width: 900,
                  height: this.props.style
                    ? this.props.style.height
                    : window.innerHeight - 140,
                }}
              />
            </WeaNewScroll>
          </Spin>
        </div>
      </WeaDialog>
    );
  }
}
